<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>Test Index2</title>
        <%= stylesheet_link_tag "../javascripts/ext/resources/css/ext-all.css" %>
        <%= javascript_include_tag "ext/adapter/prototype/prototype.js" %>
        <%= javascript_include_tag "ext/adapter/prototype/scriptaculous.js" %>
        <%= javascript_include_tag "ext/adapter/prototype/effects.js" %>
        <%= javascript_include_tag "ext/adapter/prototype/ext-prototype-adapter.js" %>
        <%= javascript_include_tag "ext/ext-all-debug.js" %>
        <%= javascript_include_tag "ext/build/locale/ext-lang-zh_CN.js" %>
    </head>
    <body>
    	<table><tr><td id="test"></td></tr></table>
        <form id="form1">
            <input type="text" size="10" name="div_airport_name" id="div_airport_name" />
        </form>
        <script>
            Ext.onReady(function(){
                /*
                 * Ext.ux.ItemSelector Example Code
                 */
                Ext.QuickTips.init();
                Ext.form.Field.prototype.msgTarget = 'side';
                var airportname = new Ext.form.TextField({
                    fieldLabel: '空港名称',
                    allowBlank: false,
                    name: 'div_airport_name',
                    anchor: '90%',
                    applyTo: 'div_airport_name'
                });
                var loginForm = new Ext.FormPanel({
                    //labelAlign: 'top',
                    labelWidth: 75, // label settings here cascade unless overridden
                    url: '/test/accform6',
                    //frame: true,
                    //title: '系统登录',
                    bodyStyle: 'padding:5px 5px 0',
                    width: 550,
                    defaults: {
                        width: 230
                    },
                    defaultType: 'textfield',
                    items: [airportname],
                    buttons: [{
                        text: '提交',
                        handler: onItemClick
                    }, {
                        text: '取消',
                        handler: onItemClick
                    }]
                });
                loginForm.render('test');
                function onItemClick(item){
                    alert(loginForm.form.getValues(true));
                    loginForm.form.submit()
                }
            });
        </script>
    </body>
</html>
